let buf = Buffer.alloc(20);//20个字节 长度为20且用0填充的buffer
console.log(buf);
//00 00 00 00....
let buff = Buffer.alloc(20, 1);//20个字节 填充为1
console.log(buff);
//01 01 01 01...

let buf1 = Buffer.from("hello node");//把字符串转成buffer实例 即用二进制数据表示
console.log(buf1);
//68 65 6c 6c 6f 20 6e 6f 64 65
console.log(buf1.length);//获取当前实例在字节数上分配的内存量
//10